{% extends "base5050.html" %}
{% load humanize %}

{% block title %}Homepage{% endblock %}


{% block lcontent %}
<h1>Groups<span class="bd-header-link"> <a href="/group/">view all</a></span></h1>
<ul>
{% for group in groups %}
	<li>{{ group.get_profile.link }}
{% empty %}
	<li>No groups have been created
{% endfor %}
</ul>
<br/>

<h1>Users</h1>
<ul>
{% for user in users %}
	<li>{{ user.get_profile.link }}</a>
{% endfor %}
</ul>
<br/>

{% if versions %}
	<h1>Recent Updates</h1>
	<ul>
	{% for version in versions %}
		<li><a href="{{ version.get_absolute_url }}">{{ version.pickle_field.title }}</a>
			on {{ version.created|naturalday }}
			by <a href="{{ version.user.get_absolute_url }}">{{ version.user.get_full_name }}</a>

	{% endfor %}
	</ul>
{% endif %}

{% endblock %}


{% block rcontent %}

{% if comments %}
<h1>Recent Comments</h1>
<ul>
	{% for comment in comments %}
		<li><b><a href="{{ comment.get_absolute_url }}">{{ comment.content_object.title }}</a></b>
			{{ comment.submit_date|naturalday }}
			by <a href="{{ comment.user.get_absolute_url }}">{{ comment.user.get_full_name }}</a>
			<p>{{ comment.comment|linebreaks|truncatewords:15 }}</p>
		</li>
	{% endfor %}
</ul>
<br/>
{% endif %}

{% endblock %}
